package com.zzw.springboot.bean;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;

import java.io.Serializable;
import java.util.Date;

/**
 * 库存变动记录实体类
 */
@TableName("t_stock_change")
public class StockChange implements Serializable {
    // 变动ID
    @TableId(value = "change_id", type = IdType.AUTO)
    private Integer changeId;

    // 商品ID
    private Integer productId;

    // 变动类型：1-入库，2-出库，3-盘盈，4-盘亏，5-调拨
    private Integer changeType;

    // 变动数量
    private Integer changeQuantity;

    // 变动前数量
    private Integer beforeQuantity;

    // 变动后数量
    private Integer afterQuantity;

    // 相关单据ID
    private Integer relatedId;

    // 单据类型：1-采购单，2-销售单，3-盘点单，4-调拨单
    private Integer relatedType;

    // 仓库ID
    private Integer warehouseId;

    // 操作人ID
    private Integer operatorId;

    // 备注
    private String remark;

    // 创建时间
    private Date createTime;

    // 非数据库字段
    // 商品名称
    @TableField(exist = false)
    private String productName;

    // 商品编码
    @TableField(exist = false)
    private String productCode;

    // 仓库名称
    @TableField(exist = false)
    private String warehouseName;

    // 操作人姓名
    @TableField(exist = false)
    private String operatorName;

    public Integer getChangeId() {
        return changeId;
    }

    public void setChangeId(Integer changeId) {
        this.changeId = changeId;
    }

    public Integer getProductId() {
        return productId;
    }

    public void setProductId(Integer productId) {
        this.productId = productId;
    }

    public Integer getChangeType() {
        return changeType;
    }

    public void setChangeType(Integer changeType) {
        this.changeType = changeType;
    }

    public Integer getChangeQuantity() {
        return changeQuantity;
    }

    public void setChangeQuantity(Integer changeQuantity) {
        this.changeQuantity = changeQuantity;
    }

    public Integer getBeforeQuantity() {
        return beforeQuantity;
    }

    public void setBeforeQuantity(Integer beforeQuantity) {
        this.beforeQuantity = beforeQuantity;
    }

    public Integer getAfterQuantity() {
        return afterQuantity;
    }

    public void setAfterQuantity(Integer afterQuantity) {
        this.afterQuantity = afterQuantity;
    }

    public Integer getRelatedId() {
        return relatedId;
    }

    public void setRelatedId(Integer relatedId) {
        this.relatedId = relatedId;
    }

    public Integer getRelatedType() {
        return relatedType;
    }

    public void setRelatedType(Integer relatedType) {
        this.relatedType = relatedType;
    }

    public Integer getWarehouseId() {
        return warehouseId;
    }

    public void setWarehouseId(Integer warehouseId) {
        this.warehouseId = warehouseId;
    }

    public Integer getOperatorId() {
        return operatorId;
    }

    public void setOperatorId(Integer operatorId) {
        this.operatorId = operatorId;
    }

    public String getRemark() {
        return remark;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public String getProductName() {
        return productName;
    }

    public void setProductName(String productName) {
        this.productName = productName;
    }

    public String getProductCode() {
        return productCode;
    }

    public void setProductCode(String productCode) {
        this.productCode = productCode;
    }

    public String getWarehouseName() {
        return warehouseName;
    }

    public void setWarehouseName(String warehouseName) {
        this.warehouseName = warehouseName;
    }

    public String getOperatorName() {
        return operatorName;
    }

    public void setOperatorName(String operatorName) {
        this.operatorName = operatorName;
    }

    @Override
    public String toString() {
        return "StockChange{" +
                "changeId=" + changeId +
                ", productId=" + productId +
                ", changeType=" + changeType +
                ", changeQuantity=" + changeQuantity +
                ", beforeQuantity=" + beforeQuantity +
                ", afterQuantity=" + afterQuantity +
                ", relatedId=" + relatedId +
                ", relatedType=" + relatedType +
                ", warehouseId=" + warehouseId +
                ", operatorId=" + operatorId +
                ", remark='" + remark + '\'' +
                ", createTime=" + createTime +
                ", productName='" + productName + '\'' +
                ", productCode='" + productCode + '\'' +
                ", warehouseName='" + warehouseName + '\'' +
                ", operatorName='" + operatorName + '\'' +
                '}';
    }
}
